package com.kepler.social.common.constants;

/**
 * 1-100 非业务
 */
public enum BusinessState {

    OK(0, "成功"),

    DUPLICATE_REQUESTS(1, "重复请求"),
    PARTIALLY_DONE(2, "部分完成"),  // 比如：调用多个子系统，只完成一部分; 调用分多个阶段，只完成某几个阶段。
    PROCESSING(3, "进行中"),

    PARAM_ERROR(200, "参数错误"),

    BUSINESS_ERROR(300, "业务异常"),

    AUTHENTICATION_ERROR(400, "鉴权异常"),
    INSUFFICIENT_PERMISSION(403, "权限不足"),

    SYS_ERROR(500, "系统异常"),

    UNKNOWN_ERROR(999, "未知错误"),
    ;

    public Integer code;
    public String message;

    BusinessState(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
